﻿/*
 * Copyright (c) 2009, Thiago M. Sayao <thiago.sayao@gmail.com>
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 *  * Redistributions of source code must retain the above copyright notice, 
 *    this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *  * Neither the name of the author nor the names of its contributors may be 
 *    used to endorse or promote products derived from this software without 
 *    specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 * POSSIBILITY OF SUCH DAMAGE.
 */

using System.Configuration;

namespace DotNetBurner
{
    public class StorySettings : ConfigurationSection
    {
        private static StorySettings settings = ConfigurationManager.GetSection ("StorySettings") as StorySettings;

        public static StorySettings Settings
        {
            get
            {
                return settings;
            }
        }

        [ConfigurationProperty ("storyPerPage", DefaultValue = "15", IsRequired = true)]
        public int StoryPerPage
        {
            get { return (int)this["storyPerPage"]; }
            set { this["storyPerPage"] = value; }
        }

        [ConfigurationProperty("tagsPerPage", DefaultValue = "100", IsRequired = true)]
        public int TagsPerPage
        {
            get { return (int)this["tagsPerPage"]; }
            set { this["tagsPerPage"] = value; }
        }

        [ConfigurationProperty("relatedStories", DefaultValue = "5", IsRequired = true)]
        public int RelatedStories
        {
            get { return (int)this["relatedStories"]; }
            set { this["relatedStories"] = value; }
        }

        [ConfigurationProperty ("storyPerFeed", DefaultValue = "30", IsRequired = true)]
        public int StoryPerFeed
        {
            get { return (int)this["storyPerFeed"]; }
            set { this["storyPerFeed"] = value; }
        }

        [ConfigurationProperty ("topTags", DefaultValue = "50", IsRequired = true)]
        public int TopTags
        {
            get { return (int)this["topTags"]; }
            set { this["topTags"] = value; }
        }

        [ConfigurationProperty ("maxTagsPerStory", DefaultValue = "5", IsRequired = true)]
        public int MaxTagsPerStory
        {
            get { return (int)this["maxTagsPerStory"]; }
            set { this["maxTagsPerStory"] = value; }
        }

        [ConfigurationProperty ("maxTagSizeInChars", DefaultValue = "30", IsRequired = true)]
        public int MaxTagSizeInChars
        {
            get { return (int)this["maxTagSizeInChars"]; }
            set { this["maxTagSizeInChars"] = value; }
        }

        [ConfigurationProperty ("minTagSizeInChars", DefaultValue = "2", IsRequired = true)]
        public int MinTagSizeInChars
        {
            get { return (int)this["minTagSizeInChars"]; }
            set { this["minTagSizeInChars"] = value; }
        }

        [ConfigurationProperty ("maxStoryDescSizeInChars", DefaultValue = "2000", IsRequired = true)]
        public int MaxStoryDescSizeInChars
        {
            get { return (int)this["maxStoryDescSizeInChars"]; }
            set { this["maxStoryDescSizeInChars"] = value; }
        }

        [ConfigurationProperty("minStoryDescSizeInChars", DefaultValue = "30", IsRequired = true)]
        public int MinStoryDescSizeInChars
        {
            get { return (int)this["minStoryDescSizeInChars"]; }
            set { this["minStoryDescSizeInChars"] = value; }
        }

        [ConfigurationProperty ("maxUrlSizeInChars", DefaultValue = "500", IsRequired = true)]
        public int MaxUrlSizeInChars
        {
            get { return (int)this["maxUrlSizeInChars"]; }
            set { this["maxUrlSizeInChars"] = value; }
        }

        [ConfigurationProperty ("maxTitleSizeInChars", DefaultValue = "255", IsRequired = true)]
        public int MaxTitleSizeInChars
        {
            get { return (int)this["maxTitleSizeInChars"]; }
            set { this["maxTitleSizeInChars"] = value; }
        }

        [ConfigurationProperty ("qualifyingVote", DefaultValue = "2", IsRequired = true)]
        public int QualifyingVote
        {
            get { return (int)this["qualifyingVote"]; }
            set { this["qualifyingVote"] = value; }
        }

        [ConfigurationProperty ("strippedDescLength", DefaultValue = "512", IsRequired = true)]
        public int StrippedDescLength
        {
            get { return (int)this["strippedDescLength"]; }
            set { this["strippedDescLength"] = value; }
        }
   }
}